package com.wlyuan.index.api.waybill.dto.waybill;

import com.alibaba.fastjson.JSONObject;
import com.wlyuan.index.api.dto.waybill.WaybillArgumentsDTO;
import com.wlyuan.tools.Authentication;
import com.wlyuan.transport.dto.common.AttachmentDTO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.Valid;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * @author yuanjie
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class WaybillCreationDTO extends Authentication implements IWaybillCreation, Serializable {
    @ApiModelProperty("订单ID")
    private Long orderId;

    @ApiModelProperty("合同号")
    private String contractNo;

    @ApiModelProperty("发货时间")
    private LocalDateTime fromTime;

    @ApiModelProperty("收货时间")
    private LocalDateTime toTime;

    @ApiModelProperty("备注")
    private String remarks;

    @ApiModelProperty("客户ID")
    private Long customerId;

    @ApiModelProperty("承运方ID")
    private Long carrierId;

    @ApiModelProperty("收货方ID")
    private Long consigneeId;

//    @Valid
//    @ApiModelProperty("发货信息")
//    private OrderAddressDTO fromAddress;

//    @Valid
//    @ApiModelProperty("收货信息")
//    private OrderAddressDTO toAddress;

    @Valid
    @ApiModelProperty("运输参数")
    private WaybillArgumentsDTO arguments;

    @Valid
    @ApiModelProperty("车辆信息")
    private WaybillVehicleDTO vehicle;

    @Valid
    @ApiModelProperty(value = "附件信息")
    private List<AttachmentDTO> attachments;

    @ApiModelProperty(value = "重量补差")
    private BigDecimal differenceWeight;

    @ApiModelProperty(value = "体积补差")
    private BigDecimal differenceVolume;

    @ApiModelProperty(value = "价值补差")
    private BigDecimal differenceValue;

    @Valid
    @ApiModelProperty("物品信息")
    private List<WaybillGoodsDTO> goodsList;

    @ApiModelProperty("运单来源")
    private Integer source;

    @ApiModelProperty("运单来源ID")
    private String sourceId;

    @ApiModelProperty("回传信息")
    private JSONObject echo;
}
